import { defHttp } from '@/apis/http'
import type { CommonAPI } from '@/apis/schema/all'

/**
 * @description: 转换规则
 */

/** 获取转换规则 */
export const getApiSiteConversionRuleApi: CommonAPI<
  '/api/site/conversion-rule',
  'get'
> = (params) => defHttp.get(`/api/site/conversion-rule`, { params })

/** 更新转换规则 */
export const updateApiSiteConversionRuleApi: CommonAPI<
  '/api/site/conversion-rule',
  'put'
> = (data) => defHttp.put(`/api/site/conversion-rule`, { data })

/** 创建转换规则 */
export const addApiSiteConversionRuleApi: CommonAPI<
  '/api/site/conversion-rule',
  'post'
> = (data) => defHttp.post(`/api/site/conversion-rule`, { data })

/** 删除转换规则 */
export const deleteApiSiteConversionRuleApi: CommonAPI<
  '/api/site/conversion-rule',
  'delete'
> = (data) => defHttp.delete(`/api/site/conversion-rule`, { data })

/** 更新转换规则优先级 */
export const updateApiSiteConversionRulePriorityApi: CommonAPI<
  '/api/site/conversion-rule/priority',
  'put'
> = (data) => defHttp.put(`/api/site/conversion-rule/priority`, { data })

/** 查询转换规则 */
export const getApiSiteConversionRuleQueryApi: CommonAPI<
  '/api/site/conversion-rule/query',
  'get'
> = (params) => defHttp.get(`/api/site/conversion-rule/query`, { params })

/** 更新转换规则状态 */
export const updateApiSiteConversionRuleStatusApi: CommonAPI<
  '/api/site/conversion-rule/status',
  'put'
> = (data) => defHttp.put(`/api/site/conversion-rule/status`, { data })
